home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n12.arc / DIRANY.BAT < prev    next >
DOS Batch File  |  1990-05-29  |  821b  |  37 lines

  1. DIRANY.BAT
  2.  
  3.  
  4. @ECHO OFF
  5. IF '%2'=='' GOTO syntax
  6. FOR %%v IN (1 2 3 4 5 6 7 8) DO IF %2==%%v GOTO OK
  7. GOTO syntax
  8. :OK
  9. SET temp=%1*.*
  10. rem If name has 8 letters, we're done
  11. IF %2==8 GOTO doit
  12. SET temp=%temp% ?%1*.*
  13. IF %2==7 GOTO doit
  14. SET temp=%temp% ??%1*.*
  15. IF %2==6 GOTO doit
  16. SET temp=%temp% ???%1*.*
  17. IF %2==5 GOTO doit
  18. SET temp=%temp% ????%1*.*
  19. IF %2==4 GOTO doit
  20. SET temp=%temp% ?????%1*.* *.%1*
  21. IF %2==3 GOTO doit
  22. SET temp=%temp% ??????%1*.* *.?%1*
  23. IF %2==2 GOTO doit
  24. SET temp=%temp% ???????%1.* *.??%1
  25. :doit
  26. FOR %%f IN (%temp%) DO ECHO %%f
  27. SET temp=
  28. GOTO end
  29. :syntax
  30. ECHO DIRANY lists files whose names contain a certain string.
  31. ECHO       Syntax: "DIRANY string n"
  32. ECHO where "string" is a string of 1 to 8 characters
  33. ECHO  (no wildcards) and "n" is the length of that string.
  34. :end
  35.  
  36.  
  37.